Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
Mac and OpenDoc are trademarks of Apple Computer, Inc.
Introduction
The info utilities get and set common properties of parts and storage units. All Getters expect you to pass in a buffer to be filled or kODNULL which causes it to create one for you. All Setters do NOT consume what you pass in, so it is safe to pass in a reference to your internal structures. They are only accessed for the duration of the Setter API call. These conventions were adopted to reduce memory allocation/deallocation.
Info Utilities
Storage unit property getters and setters:
ODULong ODGetCreationDate(Environment* ev,
ODStorageUnit* su);
Given a storage unit, gets the creation date property. Return 0 if that does not exist.
void ODSetCreationDate(Environment* ev,
ODStorageUnit* su,
ODTime dateTime);
Given a storage unit, sets the creation date property.
ODULong ODGetModificationDate(Environment* ev,
ODStorageUnit* su);
Given a storage unit, gets the modification date property. Return 0 if that does not exist.
void ODSetCreationDate(Environment* ev,
ODStorageUnit* su,
ODTime dateTime);
Given a storage unit, sets the modification date property.
ODIText* ODGetModifiedBy(Environment* ev,
ODStorageUnit* su,
ODIText* userName);
Given a storage unit, gets the name of user who modified it. Return kODNULL if that does not exist.
void ODSetModifiedBy(Environment* ev,
ODStorageUnit* su,
ODIText* userName);
Given a storage unit, sets the name of user who modified it.
ODStorageUnit* ODGetSUFromPstObj(Environment* ev,
ODPersistentObject* pstobj);
Returns the storage unit of the persistent object.
ODIText* ODGetPOComments(Environment* ev,
ODPart* part,
ODIText* comments);
Returns the comment property of the part. Returns kODNULL if there is no such property. DO NOT use on a part.
void ODSetPOComments(Environment* ev,
ODPart* part,
ODIText* comments);
Sets the comment property of the part. DO NOT use on a part.
ODIconFamily ODGetPOIconFamily(Environment* ev,
ODPart* part);
Returns the icon family for the part. Returns kODNULL if there is no such property. DO NOT use on a part.
void ODSetPOIconFamily(Environment* ev,
ODPart* part,
ODIconFamily iconFamily,
ODBoolean deleteOtherPlatformIcons =kODTrue);
Sets the icon family for the part. Will delete icon families for all other platforms if deleteOtherPlatformIcons is true.
The default for deleteOtherPlatformIcons is true. DO NOT use on a part.
ODULong ODGetPOSize(Environment* ev,
ODPersistentObject* pstobj);
Returns the size of the storage unit of the persistent object.
ODID ODGetPOID(Environment* ev,
ODPersistentObject* pstobj);
Returns the scripting ID of the persistent object.
ODIText* ODGetPOName(Environment* ev,
ODPersistentObject* pstobj,
ODIText* name);
Returns the name property of the persistent object. Returns kODNULL if that does not exists. DO NOT use on a part.
void ODSetPOName(Environment* ev,
ODPersistentObject* pstobj,
ODIText* name);
Sets the name property of the persistent object. DO NOT use on a part.
void ODSetPONameUsingSU(Environment* ev,
ODStorageUnit* su,
ODIText* name);
Sets the name property of the storage unit.
Part only property getters and setters:
ODIText* ODGetPartName(Environment* ev,
ODFrame* frame,ODIText* name);
Returns the name of the part of the frame passed in.
ODBoolean ODSetPartName(Environment* ev,
ODFrame* frame,
ODIText* name,
DescType replaceOption);
Sets the name of the part of the frame passed in. If the part is a root part, then the window name, docuemnt name may be affected. This may resulted in replacing an existing file of the same name, and so the replaceOption parameter is needed. The boolean indicated whether the operation is sucessful.
void ODRenamePartWindows(Environment *ev,
ODSession *session,
ODPart *part,
ODIText *oldName,
ODIText *name);
Renames windows with part as their root part. This call is usually not needed because ODSetPartName would normally do the job for you.
ODIText* ODGetComments(Environment* ev,
ODFrame* frame,
ODIText* comments);
Returns the comment property of the part of the frame passed in.
void ODSetComments(Environment* ev,
ODFrame* frame,
ODIText* comments);
Sets the comment property of the part of the frame passed in. If the part is a root part, then the finder comment is also affected.
ODName* ODGetCategory(Environment* ev,
ODPart* part,
ODNameSpaceManager* nsm);
Returns the category of preferred kind or the highest fidelity kind of the part.
ODName* ODGetCatFromPartSU(Environment* ev,
ODStorageUnit* su,
ODNameSpaceManager* nsm);
Returns the category of preferred kind or the highest fidelity kind of a storage unit.
ODName* ODGetCatFromKind(Environment* ev,
ODType kind,
ODNameSpaceManager* nsm);
Returns the category of a data kind.
ODType ODGetKind(Environment* ev,
ODPart* part);
Returns the preferred kind or the highest fidelity kind of the part.
ODType ODGetKindFromPartSU(Environment* ev,
ODStorageUnit* su);
Returns the preferred kind or the highest fidelity kind of the storage unit.